from flask_restful import Resource
from app import api,auth,celery,mail
from flask import jsonify,g,request
from app.models import *
from utils import *
from tasks import *
import requests

class GetresultAPI(Resource):
    decorators = [auth.login_required]
    def post(self):
        uuid = request.json.get('uuid','')
        url = "http://10.2.4.103:5555/api/task/result/{}".format(uuid)
        r = requests.get(url)
        return (r.text) 


api.add_resource(GetresultAPI, '/devops/api/v1.0/getresult', endpoint ='getresult')
